{% extends ../base.html %}

{% block head %}
    <!-- <link rel="stylesheet" href="/css/table.css"/> -->
    <script type="text/javascript" src="/static/lib/jquery.qrcode/jquery.qrcode.min.js"></script>
    <script type="text/javascript" src="/static/lib/utf.js"></script>
{% end %}

{% block body %}

    <div>
        <div>输入</div>
        <textarea id="qrcode_input" class="col-md-12" rows=5></textarea>
        <button id="generate">生成</button>
    </div>
   
    <div id="qrcode"></div>


    <script>
    $(function () {
        $("#generate").click(function () {
            var key = $("#qrcode_input").val();
            key = utf16to8(key);
            if (key) {
                $("#qrcode").html("");
                $("#qrcode").qrcode(key);
            }    
        });
    });
    </script>

{% end %}